package org.ascollada.core
{
	import org.ascollada.core.ns.collada;
	import org.ascollada.fx.DaeBindMaterial;
	
	public class DaeInstanceGeometry extends DaeElement
	{
		use namespace collada;
		
		public var url :String;
		
		public var bindMaterial :DaeBindMaterial;
		
		/**
		 * 
		 */ 
		public function DaeInstanceGeometry(document:DaeDocument, element:XML=null)
		{
			super(document, element);
		}

		/**
		 * 
		 */ 
		public override function read(element:XML):void
		{
			super.read(element);
	
			this.url = readAttribute(element, "url", true);
			
			var children :XMLList = element.children();
			
			for(var i:int = 0; i < children.length(); i++)
			{
				var child :XML = children[i];
				
				switch(child.name().localName)
				{
					case "bind_material":
						bindMaterial = new DaeBindMaterial(document, child);
						break;
					default:
						break;
				}
			}
		}
	}
}